import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { map } from "rxjs/operators";
@Injectable()
export class DesktopService {
    constructor(private http: HttpClient) { }

    /** 获取系统层级树 */
    getNavSystem() {
        return this.http.get('/system/api/initsystem').pipe(
            map((res: Response) => res['data'])
        );
    }

    /** 获取部门信息 */
    getDepartmentInfo() {
        return this.http.get('/system/api/unitinfo/getDepartmentInfo').pipe(
            map((res: Response) => res['data'])
        );
    }

    /** 获取执法动态 */
    getLawDynamicsInfo() {
        return this.http.get('/system/api/unitinfo/getLawDynamicsInfo').pipe(
            map((res: Response) => res['data'])
        );
    }

    /** 首页加载部分信息 */
    loadNotice() {
        return this.http.get('/system/api/notice/loadnotice').pipe(
            map((res: Response) => res['data'])
        );
    }

}
